/*
 * @描述: 
 * @创建者: kilomChou
 * @Date: 2020-12-04 23:24:16
 * @最后编辑: kilomChou
 * @LastEditTime: 2021-04-02 19:27:38
 */
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import typescript from 'rollup-plugin-typescript2';
import { uglify } from 'rollup-plugin-uglify';
import pkg from './package.json'

export default [
    {
        input: 'src/index.ts',
        output: {
            name: 'KCode',
            file: pkg.browser,
            format: 'umd'
        },
        plugins: [
            resolve(),
            commonjs(),
            typescript(),
            uglify()
        ]
    },
    {
        input: 'src/index.ts',
        plugins: [
            typescript()
        ],
        output: [
            { file: pkg.main, format: 'cjs' },
            { file: pkg.module, format: 'es' }
        ]
    }
]